package org.wxd.media.engine;

import org.wxd.media.api.record.MediaRecord;
import org.wxd.media.domain.Media;

/**
 * Created by wangxd on 2016/11/1.
 */
public class MediaHelper {

    public static MediaRecord asRecord(Media media) {
        return MediaRecord.newBuilder()
                .id(media.id())
                .name(media.name())
                .checksum(media.checksum())
                .moreInfo(media.moreInfo())
                .size(media.size())
                .suffix(media.suffix())
                .thumbnail(media.isThumbnail())
                .contentType(media.contentType())
                .createTime(media.createTime())
                .expireTime(media.expireTime())
                .build();
    }
}
